import sys
from PyQt5.QtCore import *
from PyQt5.QtGui import *
from PyQt5.QtWidgets import *

class StatusBarDemo(QMainWindow):
    def __init__(self,parent=None):
        super(StatusBarDemo, self).__init__(parent)
        bar=self.menuBar()
        file=bar.addMenu('File')
        file.addAction('show')
        file.triggered[QAction].connect(self.processtriger)
        self.setCentralWidget(QTextEdit())
        self.statusBar=QStatusBar()
        self.setStatusBar(self.statusBar)

    def processtriger(self,q):
        if(q.text()=='show'):
            self.statusBar.showMessage(q.text()+' was clicked')

if __name__ == '__main__':
    app=QApplication(sys.argv)
    demo=StatusBarDemo()
    demo.show()
    sys.exit(app.exec_())